import com.pojo.Customer;
import com.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class CustomerTest {
    @Test
    public void findCustomerByNameAndJobsTest(){
        SqlSession session = MyBatisUtils.getSession();
        Customer customer = new Customer();
        customer.setUsername("jack");
        customer.setJobs("teacher");
        List<Customer> customers = session.
                selectList("com.mapper.CustomerMapper.findCustomerByNameAndJobs",customer);
        for (Customer customer1:customers){
            System.out.println(customer1);
        }
        session.close();
    }
    @Test
    public void findByArrayTest(){
        SqlSession session = MyBatisUtils.getSession();
        Integer[] roleIds = {2,3};
        List<Customer> customers =session.
                selectList("com.mapper.CustomerMapper.findByArray",roleIds);
        for (Customer customer:customers){
            System.out.println(customer);
        }
        session.close();
    }
}
